﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;

namespace SmallControls
{
    /// <summary>
    /// Interaction logic for userDateTime.xaml
    /// </summary>
    public partial class userDateTime : UserControl
    {
        public userDateTime()
        {
            InitializeComponent();
            txtDate.Text = DateTime.Now.ToString("d.M.yyyy");
            txtTime.Text = DateTime.Now.ToString("H:m");
            DispatcherTimer timer = new DispatcherTimer(new TimeSpan(0, 1, 0), DispatcherPriority.Normal, delegate
            {
                txtDate.Text = DateTime.Now.ToString("d.M.yyyy");
                txtTime.Text = DateTime.Now.ToString("H:m");
            }, this.Dispatcher);
        }
    }
}
